package de.ishuo.netzclubminutecounter;

import java.awt.Image;
import java.awt.Toolkit;

import javax.swing.SwingUtilities;
import javax.swing.UIManager;

import com.apple.eawt.Application;

@SuppressWarnings("restriction")
public class Main {

	private static boolean isOnMac = System.getProperty("os.name").toLowerCase().startsWith("mac os x");
	private static boolean isOnLinux = System.getProperty("os.name").toLowerCase().contains("nix") || 
										System.getProperty("os.name").toLowerCase().contains("nux");
	
	public static boolean isOnMac() {
		return isOnMac;
	}
	
	public static boolean isOnLinux() {
		return isOnLinux;
	}
	
	
	public static void main(String[] args) {
		if (isOnMac()) {
			System.setProperty("apple.laf.useScreenMenuBar", "true");
			System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Netzclub Minute Counter");
			
			Image icon = Toolkit.getDefaultToolkit().getImage("res/logo/nmc-logo.png");
			Application.getApplication().setDockIconImage(icon);
		}
		
		try {
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		SwingUtilities.invokeLater(new Runnable() {
			
			@Override
			public void run() {
				new ViewController();
				
			}
		});
	}
	
}
